package cn.zhouchao.system.service.impl;

import cn.zhouchao.basic.service.impl.BaseServiceImpl;
import cn.zhouchao.system.domain.Systemdictionarytype;
import cn.zhouchao.system.mapper.SystemdictionarydetailMapper;
import cn.zhouchao.system.mapper.SystemdictionarytypeMapper;
import cn.zhouchao.system.service.ISystemdictionarytypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemdictionarytypeServiceImpl extends BaseServiceImpl<Systemdictionarytype> implements ISystemdictionarytypeService {

    @Autowired
    private SystemdictionarytypeMapper systemdictionarytypeMapper;

    @Autowired
    private SystemdictionarydetailMapper systemdictionarydetailMapper;

    /*级联删除单个*/
//    @AnnSysR(des = "数据类型的级联删除单个方法",weyname = "delete")
//    @Transactional
    @Override
    public void delete(Long id) {
        systemdictionarydetailMapper.deleteByTypeId(id);
        systemdictionarytypeMapper.delete(id);
    }

    /*级联批量删除*/
//    @AnnSysR(des = "数据类型的级联批量删除方法",weyname = "batchDelete")
//    @Transactional
    @Override
    public void batchDelete(List<Long> ids) {
        systemdictionarydetailMapper.batchDeleteByTypeId(ids);
        systemdictionarytypeMapper.batchDelete(ids);
    }

    //=========================== 重写以下方法/加事务/加日志注解 =================================
//    /*新增*/
//    @AnnSysR(des = "数据类型的添加方法",weyname = "add")
//    @Transactional
//    @Override
//    public void add(Systemdictionarytype systemdictionarytype) {
//        super.add(systemdictionarytype);
//    }

//    /*修改*/
//    @AnnSysR(des = "数据类型的修改方法",weyname = "update")
//    @Transactional
//    @Override
//    public void update(Systemdictionarytype systemdictionarytype) {
//        super.update(systemdictionarytype);
//    }
}
